﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using BingVis.SilverlightClient.Common;
using System.Collections.Generic;
using System.Windows.Resources;

namespace BingVis.SilverlightClient.GoogleTransit
{
    public class SilverlightFileLoader : IFileLoader
    {
        private const string filePath = "TestFiles/";
        private string[] fileNames = new string[] 
        {
            "8-12-2009_faresCompressed.txt",
            "stops.txt",
        };

        public SilverlightFileLoader()
        {
            
        }

        #region IFileLoader Members

        public IEnumerable<IGTFSFile> Files 
        {
            get
            {
                foreach (var fName in fileNames)
                {
                    var fileSource = Application.GetResourceStream(
                        new Uri(filePath + fName, UriKind.Relative));

                    yield return new GTFSFile(filePath + fName, fName, fileSource.Stream);
                }
            }
        }

        #endregion
    }
}
